package com.bw.heishou.Utilise;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bw.heishou.App;
import com.bw.heishou.R;

public class ImageLoading {
    public void LoadIma(Context context, String path, ImageView imageView){
        Glide.with(context).load(path).into(imageView);
    }
    public void LoadImaCirCle(String path, ImageView imageView){
        Glide.with(App.context).load(path).transform(new CircleCrop()).into(imageView);
    }
    public void LoadImaDraCirCle(int path, ImageView imageView){
        Glide.with(App.context).load(path).transform(new CircleCrop()).into(imageView);
    }
    public void LoadImaUriCirCle(Uri uri, ImageView imageView){
        Glide.with(App.context).load(uri).transform(new CircleCrop()).into(imageView);
    }

    static ImageLoading imageLoading;
    public static ImageLoading getInstance(){
        if (imageLoading==null){
            synchronized (ImageLoading.class){
                if (imageLoading==null){
                    imageLoading=new ImageLoading();
                }
            }
        }
        return imageLoading;
    }
}
